/*
 * @Author: 'Chenfarry' '2925102113@qq.com'
 * @Date: 2024-07-22 11:25:00
 * @LastEditors: chenhuanhuan 2925102113@qq.com
 * @LastEditTime: 2024-09-23 20:16:02
 * @FilePath: \orderApp\service\business\goods\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { httpGet, httpPost } from '@/utils/http'
import type {
  NowInfo,
  DishType,
  KitchenType,
  PepastType,
  HistoryRecipe,
  QuestionnaireType,
  AdviceInfo,
  commnAdviceInfo,
  dishInfo,
  dishesHotType,
  Complain
} from './type'

/** 请求当前日期餐次数据 */
export const reqCurDate = (params = {}) => {
  return httpGet<NowInfo>('/commentApp/user/getNowDate', params)
}

/** 请求当前菜肴数据集 */
export const reqWeekRecipe = (params = {}) => {
  return httpGet<DishType>('/commentApp/recipe/getWeekRecipes', params)
}

/** 请求所有食堂列表 */
export const reqAllKitchen = (params = {}) => {
  return httpGet<KitchenType>('/auth/organ/unit_info/all_kitchen', params)
}

/** POST 请求 */
export const addBudgetOrder = (params = {}) => {
  return httpPost('/commentApp/dish/addBudgetOrder', params)
}

/** 请求每周就餐预定信息 */
export const reqPepastInfo = (params = {}) => {
  return httpGet<PepastType>('/commentApp/dish/getWeekRepast', params)
}

/** 修改预定就餐 */
export const modifyRepast = (params = {}) => {
  return httpPost('/commentApp/dish/alterUserRepast', params)
}

/**
 * 请求历史食谱
 */

export const reqHistoryRecipe = (params = {}) => {
  return httpGet<HistoryRecipe>('/commentApp/recipe/getRecipeInfo', params)
}

/**
 * 请求食谱详情
 */
export const reqRecipeDtl = (params = {}) => {
  return httpGet<DishType>('/commentApp/recipe/getRecipeDtl', params)
}

/**
 * 伙食问卷信息
 */
export const reqQuestionnaire = (params = {}) => {
  return httpGet<QuestionnaireType>('/commentApp/quest/getQuestionnaire', params)
}

/** 伙食问卷 */
export const saveQuestionnaire = (params = {}) => {
  return httpPost('/commentApp/quest/saveQuestionnaire', params)
}

/**
 * 就餐评议信息
 */
export const reqComplainAdvice = (params = {}) => {
  return httpGet<AdviceInfo[]>('/commentApp/complain/selectComplainAdvice', params)
}

/**
 * 就餐建议信息
 */
export const reqCommnAdvice = (params = {}) => {
  return httpGet<commnAdviceInfo[]>('/commentApp/complain/getCommnAdvice', params)
}

/**
 * 发布就餐建议信息
 */
export const reqSaveAdive = (params = {}) => {
  return httpGet<commnAdviceInfo[]>('/commentApp/complain/setComplainAdvice', params)
}

/**
 * 菜品详情
 */
export const reqDishInfo = (params = {}) => {
  return httpGet<dishInfo>('/commentApp/dish/getDishInfo', params)
}

/**
 *
 * @param params
 * @returns 菜品评价状态
 */
export const requdgeDish = (params = {}) => {
  return httpGet<number>('/commentApp/dish/judgeDishEvaluate', params)
}

/**
 *
 * @param params
 * @returns 菜肴评价信息
 */

export const reqComplaiComment = (params = {}) => {
  return httpGet<any>('/commentApp/dish/getComplainAdvice', params)
}

/**
 * 排行榜数据
 */
// 菜品排行榜
export const reqDishRanking = (params = {}) => {
  return httpGet<dishesHotType>('/commentApp/dish/getDishRanking', params)
}
// 点菜排行榜
export const reqNextWeekOrder = (params = {}) => {
  return httpGet<any>('/commentApp/dish/getNextWeekOrder', params)
}

/**
 * 点赞/取消就餐点赞评论
 */

export const reqLikeEvaluater = (params = {}) => {
  return httpGet<any>('/commentApp/dish/saveLikeEvaluate', params)
}
export const reqDeleteLikeEvaluater = (params = {}) => {
  return httpGet<any>('/commentApp/dish/deleteLikeEvaluate', params)
}



/**
 * 点赞/取消伙食评议点赞评论
 */

export const reqLikeComplain = (params = {}) => {
  return httpGet<any>('/commentApp/complain/alterLikeComplain', params)
}


/**
 * 评价菜肴 查询
 */
export const reqAdviceDraft = (params = {}) => {
  return httpGet<Complain>('/commentApp/dish/selectAdviceDraft', params)
}


/**
 * 评价菜肴 保存
 */
export const saveComplainAdvice = (params = {}) => {
  return httpPost<Complain>('/commentApp/dish/saveComplainAdvice', params)
}


/**
 * 评价菜肴 草稿
 */
export const saveAdviceDraft = (params = {}) => {
  return httpPost<Complain>('/commentApp/dish/saveAdviceDraft', params)
}

/**
 * 评价菜肴 删除草稿
 */
export const deleteAdviceDraft = (params = {}) => {
  return httpGet<Complain>('/commentApp/dish/deleteAdviceDraft', params)
}

